package com.cy.ppj.model.ao.product;

import com.cy.ppj.model.enums.Process;
import com.cy.ppj.model.enums.SignType;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @description: 产品
 * @author: Ocean
 * @create: 2018-07-17 16:53
 **/
@Data
@ApiModel("产品")
public class ProductAddAO {

    @ApiModelProperty(value = "产品名称", required = true)
    @NotEmpty(message = "产品名称不可为空")
    private String name;

    @ApiModelProperty(value = "最小贷款额度", example = "5", required = true)
    @NotNull(message = "最小贷款额度不可为空")
    private BigDecimal minCreditLimit;

    @ApiModelProperty(value = "最大贷款额度", example = "20", required = true)
    @NotNull(message = "最大贷款额度不可为空")
    private BigDecimal maxCreditLimit;

    @ApiModelProperty(value = "热门排序", example = "0")
    private Integer hotOrder;

    @ApiModelProperty(value = "标签文本-展示用")
    private String tagsText;

    @ApiModelProperty(value = "icon路径", required = true)
    @NotEmpty(message = "icon路径不可为空")
    private String iconPath;

    @ApiModelProperty(value = "标签ID", required = true)
    private Long[] tagIds;

    @ApiModelProperty(value = "准入条件", required = true)
    @NotEmpty(message = "准入条件不可为空")
    private String accessConditon;

    @ApiModelProperty(value = "征信条件")
    private String creditCondition;

    @ApiModelProperty(value = "所需资料", required = true)
    @NotEmpty(message = "所需资料不可为空")
    private String requiredInfomation;

    @ApiModelProperty(value = "利率", required = true)
    @NotEmpty(message = "利率信息不可为空")
    @Valid
    private List<ProductRateAO> rateOptions;

    @ApiModelProperty(value = "产品类型ID", example = "1", required = true)
    @NotNull(message = "产品类型不可为空")
    private Long typeId;

    @ApiModelProperty(value = "资金方ID", example = "1", required = true)
    @NotNull(message = "资金方不可为空")
    private Long sourceId;

    @ApiModelProperty(value = "审核流程", required = true)
    @NotEmpty(message = "审核流程不可为空")
    private Process[] processes;

    @ApiModelProperty(value = "签约流程", required = true)
    @NotEmpty(message = "签约流程不可为空")
    private String[] contractProcesses;

    @ApiModelProperty(value = "推荐语", required = true)
    @NotEmpty(message = "推荐语不可为空")
    private String recommendation;
    
    @ApiModelProperty(value = "签约类型", required = true)
    @NotNull(message = "签约类型不可为空")
    private SignType signType;

    @ApiModelProperty(value = "是否代扣", required = true)
    @NotNull(message = "是否代扣不可为空")
    private boolean useWithhold;
    
    @ApiModelProperty(value = "是否返佣", required = true)
    @NotNull(message = "是否返佣不可为空")
    private boolean useCommission;
    
    @ApiModelProperty(value = "代扣点数", example = "0.00")
    private BigDecimal withholdRate;
    
    @ApiModelProperty(value = "佣金点数", example = "0.00")
    private BigDecimal commissionRate;
    
    @ApiModelProperty(value = "城市ID", required = true)
    private Long[] cityIds;
    
    @ApiModelProperty(value = "产品方登录说明页面地址")
    private String sourceLoginUrl;
    
    @ApiModelProperty(value = "产品方地址 ")
    private String sourceUrl;
    
    @ApiModelProperty(value = "是否推广 ")
    @NotNull(message = "是否推广不可为空")
    private boolean extend;
    
    @ApiModelProperty(value = "推广二维码地址")
    private String extendQRCodePath;
    
    @ApiModelProperty(value = "推广页图片地址")
    private String extendPagePath;
}
